//
//  LGFollowMedicineAddFooter.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/6/25.
//  新增服药统计

#import "LGFollowMedicineAddFooter.h"

@interface LGFollowMedicineAddFooter()

/**   */
@property (nonatomic , strong)UIView *baseView;

@end

@implementation LGFollowMedicineAddFooter

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.clipsToBounds = YES;
        self.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
        [self addSubview:self.baseView];
        [self.baseView addSubview:self.addButton];
        [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.equalTo(self).offset(-viewPix(8));
            make.left.equalTo(self).offset(viewPix(16));
            make.right.equalTo(self).offset(-viewPix(16));
        }];
        [self.addButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.baseView).offset(viewPix(16));
            make.right.equalTo(self.baseView).offset(-viewPix(16));
            make.bottom.equalTo(self.baseView).offset(-viewPix(12));
            make.height.equalTo(@(viewPix(32)));
        }];
    }
    return self;
}


-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B2BDC7" offset:CGSizeMake(0, 2) opacity:0.15 radius:10];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UIButton *)addButton{
    if(!_addButton){
        _addButton = [UIButton buttonWithTitle:@"新增" titleFont:LGFontWeight(16, UIFontWeightMedium) textColor:@"#3291FF" imageName:@""];
        _addButton.layer.borderColor = [UIColor colorWithString:@"#CCE4FF"].CGColor;
        _addButton.layer.borderWidth = 1;
        _addButton.cornerRidus = viewPix(16);
    }
    return _addButton;
}

@end
